#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <memory>
#include <getopt.h>
#include <string.h>
#include <sys/time.h>
#include <iomanip>
#include <fstream>
#include <functional>
#include <inttypes.h>
#include <signal.h>
#include "SocEmu.h"

#define COLOR_NONE "\033[0m"
#define FONT_COLOR_RED "\033[0;31m"
#define FONT_COLOR_GREEN "\033[0;32m"
#define FONT_COLOR_BLUE "\033[0;34m"

enum { run , finish };
int emu_state = run;
bool isFinish() {
    return emu_state == finish;
}
void setFinish() {  emu_state = finish; }

void sigint_handler(int sig)
{
    if(sig == SIGINT) {
        printf("\nctrl + c pressed! this emu cycles = %ld\n", main_cycles);
        setFinish();
    }
}

int main(int argc, const char** argv)
{
    signal(SIGINT, sigint_handler);

    auto emu = SocEmu(argc, argv);
    emu.execute();

    return 0;
}